$(window).ready(function(){
        $(".detaInfor_PackUp").click(function(){
            $(".detaInfor_PackUp").effect( 'slide', 500 );
            // $(".select").hide(500);
            if($(".select").css("display")!="none"){
                $(".select").hide(500);
            }
            else{
                $(".select").effect("slide",800);
            }
        });
        /*查看分类效果*/
        /*-------*/
        /*$("#home #Pagination").pagination("100");
        $("#ios #Pagination").pagination("100");
        $("#jmeter #Pagination").pagination("100");*/
        /*------*/
        /*---详细选择框--*/
        //-------------------------
        /*
        *   函数封装
         */
        let judgeTextFn = (ele)=>{
            if($(ele).children("dl").children("dd").text()===""){
                $(ele).children("dl").children("dd").text("暂时没有选择过滤条件");
            }
        };
        let IdCheck = {
            "select1":"selectA",
            "select2":"selectB",
            "select3":"selectC",
            "select4":"selectD"
        };
    let {entries} = Object;
        let removeChildFn = (ele,fDom,clickIndex)=>{
            setTimeout(()=>{
                $(ele).eq(clickIndex).find(fDom).each((index,ele)=>{
                    $(ele).on('click',()=>{
                        for(let [key,value] of entries(IdCheck)){
                            if($(ele).attr('id') === value){
                                console.log(1);
                                $('dl#'+key).eq(clickIndex).find('dd.selected').removeClass('selected').siblings('dd.select-all').addClass('selected');
                            }
                        }
                        $(ele).remove();
                        judgeTextFn("#home .select-result");
                        judgeTextFn("#ios .select-result");
                        judgeTextFn("#jmeter .select-result");
                        //---------------测试返回原来的位置-------------------

                    });
                });
            },0);
        };
        //-----------------------------
        $("#home #select1").children("dd").click(function(){
            $(this).addClass("selected").siblings().removeClass("selected");
            if($(this).hasClass("selected")===true){
                var newdd1=$($(this)).clone();
                removeChildFn('.select-result',newdd1[0],0);
                if($("#home .select-result").children("dl").children("dd").text()==="暂时没有选择过滤条件"){
                    $("#home .select-result").children("dl").children("dd").text("").parent().append(newdd1.attr("id","selectA"));
                }
                if($(this).hasClass("select-all")===true){
                    $("#home .select-result").children("dl").children("#selectA").remove();
                    if($("#home .select-result").children("dl").children("dd").text()===""){
                        $("#home .select-result").children("dl").children("dd").text("暂时没有选择过滤条件");
                    }
                }
                if($(this).hasClass("select-all")===false&&$(".select-result").children("dl").children("#selectA")!=null){
                    $("#home .select-result").children("dl").children("#selectA").remove();
                    $("#home .select-result").children("dl").append(newdd1.attr("id","selectA"));
                }
            }
        });

        $("#home #select2").children("dd").click(function(){
            $(this).addClass("selected").siblings().removeClass("selected");
            if($(this).hasClass("selected")===true){
                var newdd2=$($(this)).clone();
                removeChildFn('.select-result',newdd2[0],0);
                if($("#home .select-result").children("dl").children("dd").text()==="暂时没有选择过滤条件"){
                    $("#home .select-result").children("dl").children("dd").text("").parent().append(newdd2.attr("id","selectB"));
                }
                if($(this).hasClass("select-all")===true){
                    $("#home .select-result").children("dl").children("#selectB").remove();
                    if($("#home .select-result").children("dl").children("dd").text()===""){
                        $("#home .select-result").children("dl").children("dd").text("暂时没有选择过滤条件");
                    }
                }
                if($(this).hasClass("select-all")===false&&$(".select-result").children("dl").children("#selectB")!=null){
                    $("#home .select-result").children("dl").children("#selectB").remove();
                    $("#home .select-result").children("dl").append(newdd2.attr("id","selectB"));
                }
            }
        });

        $("#home #select3").children("dd").click(function(){
            $(this).addClass("selected").siblings().removeClass("selected");
            if($(this).hasClass("selected")===true){
                var newdd3=$($(this)).clone();
                removeChildFn('.select-result',newdd3[0],0);
                if($("#home .select-result").children("dl").children("dd").text()==="暂时没有选择过滤条件"){
                    $("#home .select-result").children("dl").children("dd").text("").parent().append(newdd3.attr("id","selectC"));
                }
                if($(this).hasClass("select-all")===true){
                    $("#home .select-result").children("dl").children("#selectC").remove();
                    if($("#home .select-result").children("dl").children("dd").text()===""){
                        $("#home .select-result").children("dl").children("dd").text("暂时没有选择过滤条件");
                    }
                }
                if($(this).hasClass("select-all")===false&&$(".select-result").children("dl").children("#selectC")!=null){
                    $("#home .select-result").children("dl").children("#selectC").remove();
                    $("#home .select-result").children("dl").append(newdd3.attr("id","selectC"));
                }

            }
        });

        $("#home #select4").children("dd").click(function(){
            $(this).addClass("selected").siblings().removeClass("selected");
            if($(this).hasClass("selected")===true){
                var newdd4=$($(this)).clone();
                removeChildFn('.select-result',newdd4[0],0);
                if($("#home .select-result").children("dl").children("dd").text()==="暂时没有选择过滤条件"){
                    $("#home .select-result").children("dl").children("dd").text("").next().append(newdd4.attr("id","selectD"));
                }
                if($(this).hasClass("select-all")===true){
                    $("#home .select-result").children("dl").children("#selectD").remove();
                    if($("#home .select-result").children("dl").children("dd").text()===""){
                        $("#home .select-result").children("dl").children("dd").text("暂时没有选择过滤条件");
                    }
                }
                if($(this).hasClass("select-all")===false&&$(".select-result").children("dl").children("#selectD")!=null){
                    $("#home .select-result").children("dl").children("#selectD").remove();
                    $("#home .select-result").children("dl").append(newdd4.attr("id","selectD"));
                }

            }
        });
        /*home标签页*/
        $("#ios #select1").children("dd").click(function(){
            $(this).addClass("selected").siblings().removeClass("selected");
            if($(this).hasClass("selected")===true){
                var newdd1=$($(this)).clone();
                removeChildFn('.select-result',newdd1[0],1);
                if($("#ios .select-result").children("dl").children("dd").text()==="暂时没有选择过滤条件"){
                    $("#ios .select-result").children("dl").children("dd").text("").parent().append(newdd1.attr("id","selectA"));
                }
                if($(this).hasClass("select-all")===true){
                    $("#ios .select-result").children("dl").children("#selectA").remove();
                    if($("#ios .select-result").children("dl").children("dd").text()===""){
                        $("#ios .select-result").children("dl").children("dd").text("暂时没有选择过滤条件");
                    }
                }
                if($(this).hasClass("select-all")===false&&$(".select-result").children("dl").children("#selectA")!=null){
                    $("#ios .select-result").children("dl").children("#selectA").remove();
                    $("#ios .select-result").children("dl").append(newdd1.attr("id","selectA"));
                }
            }
        });

        $("#ios #select2").children("dd").click(function(){
            $(this).addClass("selected").siblings().removeClass("selected");
            if($(this).hasClass("selected")===true){
                var newdd2=$($(this)).clone();
                removeChildFn('.select-result',newdd2[0],1);
                if($("#ios .select-result").children("dl").children("dd").text()==="暂时没有选择过滤条件"){
                    $("#ios .select-result").children("dl").children("dd").text("").parent().append(newdd2.attr("id","selectB"));
                }
                if($(this).hasClass("select-all")===true){
                    $("#ios .select-result").children("dl").children("#selectB").remove();
                    if($("#ios .select-result").children("dl").children("dd").text()===""){
                        $("#ios .select-result").children("dl").children("dd").text("暂时没有选择过滤条件");
                    }
                }
                if($(this).hasClass("select-all")===false&&$(".select-result").children("dl").children("#selectB")!=null){
                    $("#ios .select-result").children("dl").children("#selectB").remove();
                    $("#ios .select-result").children("dl").append(newdd2.attr("id","selectB"));
                }
            }
        });

        $("#ios #select3").children("dd").click(function(){
            $(this).addClass("selected").siblings().removeClass("selected");
            if($(this).hasClass("selected")===true){
                var newdd3=$($(this)).clone();
                removeChildFn('.select-result',newdd3[0],1);
                if($("#ios .select-result").children("dl").children("dd").text()==="暂时没有选择过滤条件"){
                    $("#ios .select-result").children("dl").children("dd").text("").parent().append(newdd3.attr("id","selectC"));
                }
                if($(this).hasClass("select-all")===true){
                    $("#ios .select-result").children("dl").children("#selectC").remove();
                    if($("#ios .select-result").children("dl").children("dd").text()===""){
                        $("#ios .select-result").children("dl").children("dd").text("暂时没有选择过滤条件");
                    }
                }
                if($(this).hasClass("select-all")===false&&$(".select-result").children("dl").children("#selectC")!=null){
                    $("#ios .select-result").children("dl").children("#selectC").remove();
                    $("#ios .select-result").children("dl").append(newdd3.attr("id","selectC"));
                }

            }
        });

        $("#ios #select4").children("dd").click(function(){
            $(this).addClass("selected").siblings().removeClass("selected");
            if($(this).hasClass("selected")===true){
                var newdd4=$($(this)).clone();
                removeChildFn('.select-result',newdd4[0],1);
                if($("#ios .select-result").children("dl").children("dd").text()==="暂时没有选择过滤条件"){
                    $("#ios .select-result").children("dl").children("dd").text("").next().append(newdd4.attr("id","selectD"));
                }
                if($(this).hasClass("select-all")===true){
                    $("#ios .select-result").children("dl").children("#selectD").remove();
                    if($("#ios .select-result").children("dl").children("dd").text()===""){
                        $("#ios .select-result").children("dl").children("dd").text("暂时没有选择过滤条件");
                    }
                }
                if($(this).hasClass("select-all")===false&&$(".select-result").children("dl").children("#selectD")!=null){
                    $("#ios .select-result").children("dl").children("#selectD").remove();
                    $("#ios .select-result").children("dl").append(newdd4.attr("id","selectD"));
                }

            }
        });
        /*ios标签页*/
        $("#jmeter #select1").children("dd").click(function(){
            $(this).addClass("selected").siblings().removeClass("selected");
            if($(this).hasClass("selected")===true){
                var newdd1=$($(this)).clone();
                removeChildFn('.select-result',newdd1[0],2);
                if($("#jmeter .select-result").children("dl").children("dd").text()==="暂时没有选择过滤条件"){
                    $("#jmeter .select-result").children("dl").children("dd").text("").parent().append(newdd1.attr("id","selectA"));
                }
                if($(this).hasClass("select-all")===true){
                    $("#ios .select-result").children("dl").children("#selectA").remove();
                    if($("#jmeter .select-result").children("dl").children("dd").text()===""){
                        $("#jmeter .select-result").children("dl").children("dd").text("暂时没有选择过滤条件");
                    }
                }
                if($(this).hasClass("select-all")===false&&$(".select-result").children("dl").children("#selectA")!=null){
                    $("#jmeter .select-result").children("dl").children("#selectA").remove();
                    $("#jmeter .select-result").children("dl").append(newdd1.attr("id","selectA"));
                }
            }
        });

        $("#jmeter #select2").children("dd").click(function(){
            $(this).addClass("selected").siblings().removeClass("selected");
            if($(this).hasClass("selected")===true){
                var newdd2=$($(this)).clone();
                removeChildFn('.select-result',newdd2[0],2);
                if($("#jmeter .select-result").children("dl").children("dd").text()==="暂时没有选择过滤条件"){
                    $("#jmeter .select-result").children("dl").children("dd").text("").parent().append(newdd2.attr("id","selectB"));
                }
                if($(this).hasClass("select-all")===true){
                    $("#jmeter .select-result").children("dl").children("#selectB").remove();
                    if($("#jmeter .select-result").children("dl").children("dd").text()===""){
                        $("#jmeter .select-result").children("dl").children("dd").text("暂时没有选择过滤条件");
                    }
                }
                if($(this).hasClass("select-all")===false&&$(".select-result").children("dl").children("#selectB")!=null){
                    $("#jmeter .select-result").children("dl").children("#selectB").remove();
                    $("#jmeter .select-result").children("dl").append(newdd2.attr("id","selectB"));
                }
            }
        });

        $("#jmeter #select3").children("dd").click(function(){
            $(this).addClass("selected").siblings().removeClass("selected");
            if($(this).hasClass("selected")===true){
                var newdd3=$($(this)).clone();
                removeChildFn('.select-result',newdd3[0],2);
                if($("#jmeter .select-result").children("dl").children("dd").text()==="暂时没有选择过滤条件"){
                    $("#jmeter .select-result").children("dl").children("dd").text("").parent().append(newdd3.attr("id","selectC"));
                }
                if($(this).hasClass("select-all")===true){
                    $("#jmeter .select-result").children("dl").children("#selectC").remove();
                    if($("#jmeter .select-result").children("dl").children("dd").text()===""){
                        $("#jmeter .select-result").children("dl").children("dd").text("暂时没有选择过滤条件");
                    }
                }
                if($(this).hasClass("select-all")===false&&$(".select-result").children("dl").children("#selectC")!=null){
                    $("#jmeter .select-result").children("dl").children("#selectC").remove();
                    $("#jmeter .select-result").children("dl").append(newdd3.attr("id","selectC"));
                }

            }
        });

        $("#jmeter #select4").children("dd").click(function(){
            $(this).addClass("selected").siblings().removeClass("selected");
            if($(this).hasClass("selected")===true){
                var newdd4=$($(this)).clone();
                removeChildFn('.select-result',newdd4[0],2);
                if($("#jmeter .select-result").children("dl").children("dd").text()==="暂时没有选择过滤条件"){
                    $("#jmeter .select-result").children("dl").children("dd").text("").next().append(newdd4.attr("id","selectD"));
                }
                if($(this).hasClass("select-all")===true){
                    $("#jmeter .select-result").children("dl").children("#selectD").remove();
                    if($("#jmeter .select-result").children("dl").children("dd").text()===""){
                        $("#jmeter .select-result").children("dl").children("dd").text("暂时没有选择过滤条件");
                    }
                }
                if($(this).hasClass("select-all")===false&&$(".select-result").children("dl").children("#selectD")!=null){
                    $("#jmeter .select-result").children("dl").children("#selectD").remove();
                    $("#jmeter .select-result").children("dl").append(newdd4.attr("id","selectD"));
                }

            }
        });
        //点击后消失
        var ResultDl=document.getElementById('select5');
        var ddArr=ResultDl.children;
        /*
        *   新添加的
        */

    });